{
  "cells": [
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# `XXXXX_chart`\n",
        "\n",
        "!!! info \"At a glance\"\n",
        "    **Useful for:** \n",
        "\n",
        "    **API Documentation:** [XXXXXX_chart()](http://example.com)\n",
        "\n",
        "    **What is needed to generate the chart?** "
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Worked Example"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "from splink.duckdb.linker import DuckDBLinker\n",
        "import splink.duckdb.comparison_library as cl\n",
        "import splink.duckdb.comparison_template_library as ctl\n",
        "from splink.duckdb.blocking_rule_library import block_on\n",
        "from splink.datasets import splink_datasets\n",
        "import logging, sys\n",
        "logging.disable(sys.maxsize)\n",
        "\n",
        "df = splink_datasets.fake_1000\n",
        "\n",
        "settings = {\n",
        "    \"link_type\": \"dedupe_only\",\n",
        "    \"blocking_rules_to_generate_predictions\": [\n",
        "        block_on(\"first_name\"),\n",
        "        block_on(\"surname\"),\n",
        "    ],\n",
        "    \"comparisons\": [\n",
        "        ctl.name_comparison(\"first_name\"),\n",
        "        ctl.name_comparison(\"surname\"),\n",
        "        ctl.date_comparison(\"dob\", cast_strings_to_date=True),\n",
        "        cl.exact_match(\"city\", term_frequency_adjustments=True),\n",
        "        ctl.email_comparison(\"email\", include_username_fuzzy_level=False),\n",
        "    ],\n",
        "}\n",
        "\n",
        "linker = DuckDBLinker(df, settings)\n",
        "linker.training.estimate_u_using_random_sampling(max_pairs=1e6)\n",
        "\n",
        "blocking_rule_for_training = block_on([\"first_name\", \"surname\"])\n",
        "\n",
        "linker.training.estimate_parameters_using_expectation_maximisation(blocking_rule_for_training)\n",
        "\n",
        "blocking_rule_for_training = block_on(\"dob\")\n",
        "linker.training.estimate_parameters_using_expectation_maximisation(blocking_rule_for_training)\n",
        "\n"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "### What the chart shows\n"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "??? note \"What the chart tooltip shows\"\n",
        "\n",
        "    ![]()"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "### How to interpret the chart\n"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "### Actions to take as a result of the chart\n",
        "\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "base",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.9.12"
    },
    "orig_nbformat": 4
  },
  "nbformat": 4,
  "nbformat_minor": 2
}
